package Parkour;

import javax.swing.*;
import java.awt.*;

public class WindowFrame extends JFrame implements Runnable {
    JLabel background;
    JProgressBar jdt;

    public void Start() {
        WindowFrame frame = new WindowFrame();
        Thread t = new Thread(frame);
        t.start();
        dispose();
    }

    public WindowFrame() {
        background = new JLabel(new ImageIcon("images/parkour/hbg.jpg"));
        this.add(BorderLayout.NORTH, background);

        jdt = new JProgressBar();
        jdt.setStringPainted(true);
        jdt.setBackground(Color.ORANGE);
        this.add(BorderLayout.SOUTH, jdt);

        this.setSize(568, 340);
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(3);
        this.setUndecorated(true);
        this.setIconImage(new ImageIcon("images/parkour/115.png").getImage());
        this.setVisible(true);
    }

    public static void main(String[]args){
        new WindowFrame().Start();
    }

    @Override
    public void run(){
        int[]values = {0,1,3,10,10,10,23,32,32,32,40,40,40,40,47,55,66,66,66,76,86,89,95,99,99,99,100};
        for (int i=0;i<values.length;i++){
            jdt.setValue(values[i]);
            try {
                Thread.sleep(200);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
